/**
 * 
 * <p>Description:常用数据类型的缩写映射</p>
 * 
 * <p>Author: wang xing yue</p>
 * <p>Date  :Nov 8, 2013</p>
 *
 */

package com.nihao001.parse;

import java.util.HashMap;
import java.util.Map;

public class DefaultConstantMap {

	public static final String STRING_SHORT_NAME = "string";

	public static final String LIST_SHORT_NAME = "list";
	public static final String MAP_SHORT_NAME = "map";

	public static final String INT_SHORT_NAME = "int";
	public static final String LONG_SHORT_NAME = "long";
	public static final String SHORT_SHORT_NAME = "short";
	public static final String FLOAT_SHORT_NAME = "float";
	public static final String DOUBLE_SHORT_NAME = "double";
	public static final String BOOL_SHORT_NAME = "bool";

	public static final String STRING_FULL_NAME = "java.lang.String";
	public static final String LIST_FULL_NAME = "java.util.ArrayList";
	public static final String MAP_FULL_NAME = "java.util.HashMap";
	public static final String INT_FULL_NAME = "java.lang.Integer";
	public static final String LONG_FULL_NAME = "java.lang.Long";
	public static final String SHORT_FULL_NAME = "java.lang.Short";
	public static final String FLOAT_FULL_NAME = "java.lang.Float";
	public static final String DOUBLE_FULL_NAME = "java.lang.Double";
	public static final String BOOL_FULL_NAME = "java.lang.Boolean";

	private static final Map<String, String> SHORT_NAME_CLASS_MAP = new HashMap<String, String>();

	static {
		SHORT_NAME_CLASS_MAP.put(STRING_SHORT_NAME, STRING_FULL_NAME);
		SHORT_NAME_CLASS_MAP.put(LIST_SHORT_NAME, LIST_FULL_NAME);
		SHORT_NAME_CLASS_MAP.put(MAP_SHORT_NAME, MAP_FULL_NAME);
		SHORT_NAME_CLASS_MAP.put(INT_SHORT_NAME, INT_FULL_NAME);
		SHORT_NAME_CLASS_MAP.put(LONG_SHORT_NAME, LONG_FULL_NAME);
		SHORT_NAME_CLASS_MAP.put(SHORT_SHORT_NAME, SHORT_FULL_NAME);
		SHORT_NAME_CLASS_MAP.put(FLOAT_SHORT_NAME, FLOAT_FULL_NAME);
		SHORT_NAME_CLASS_MAP.put(DOUBLE_SHORT_NAME, DOUBLE_FULL_NAME);
		SHORT_NAME_CLASS_MAP.put(BOOL_SHORT_NAME, BOOL_FULL_NAME);
	}

	public static String getActullyClass(String classShortName) {
		if (classShortName == null) {
			return null;
		}
		return SHORT_NAME_CLASS_MAP.get(classShortName.toLowerCase());
	}

}
